<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <body>
        <ui:composition template="../../templates/splash/template.xhtml">
            
            <ui:define name="top"> 
                <div class="logo">
                     <h3><h:outputText value="#{msgs.mainDevelopersTitle}"/></h3>
                </div>
            </ui:define>
            <ui:define name="content"> 
                
                <!-- JS SCRIPT FOR CLICKING --> 
                 <script type="text/javascript">
                     
                     jQuery(document).ready(function($){
                           $(".details").toggle(function(){
                              var json = $(this).next().html();
                              $(this).closest('tr').after('<tr style="background-color:#FFFFEE">><td colspan="4" style="width:300px">' + json +'</td></tr>');
                              $(this).text('Hide data');
                           },function(){
                             $(this).text('View data');
                             $(this).closest('tr').next().remove();
                           });
                          
                     });// END OF JQUERY
                </script>
                <!-- END OF SCRIPT --> 
                <br/>
                <h1> RESTful web services </h1> 
                <p>Users : http://ITFriendU/services/users</p>
                  <br/>
                 <h1> Partner web services </h1> 
                 <br/>
                <f:view>
                    <h:dataTable var="webService" value="#{splashDeveloperBean.loadPartnerWebServices()}" 
                                 styleClass="webService"
                                 headerClass="webServiceHeader"
                                 rowClasses="webServiceHeaderCorrect,webServiceHeaderWrong"
    		>
                                 
                                 > 
                        <h:column>
                            <f:facet name="header">
                                 <h:outputText value="URL" />
                            </f:facet> 
                            <h:outputText value="#{webService.url}"></h:outputText>
                        </h:column>
                         <h:column>
                            <f:facet name="header">
                                 <h:outputText value="Status" />
                            </f:facet> 
                             <h:outputText value="#{webService.status}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                 <h:outputText value="Error" />
                            </f:facet> 
                            <h:outputText value="#{webService.error}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Details" />
                            </f:facet> 
                            <c:if test="#{webService.JSON != ''}">
                                <p class="details" style="cursor:pointer"> <h:outputText value="View data"></h:outputText></p>
                                  <div class="hiddenJson" style="display:none">
                                       #{webService.JSON}
                                  </div>
                             </c:if>
                             <c:if test="#{webService.JSON == ''}">
                                <h:outputText value="No source avaliable"></h:outputText>
                            </c:if>
                        </h:column>
                   </h:dataTable>
            </f:view>
                 
            </ui:define>
            
        </ui:composition>
       
    </body>
   
</html>